<template>
	<view>
		<uni-list>
			<uni-list :border="true">
				<!-- 右侧带角标 -->
				<uni-list-chat v-for="(item,index) in meetingList" :title="item.name" avatar="../../static/images/icon/meeting.png" :note="item.number" badge-text="12">
					<view class="chat-custom-right">
						<text class="chat-custom-text" :style="getBackgroundColor(item.status)">{{item.status}}</text>
						<!-- 需要使用 uni-icons 请自行引入 -->
						<!-- <uni-icons type="star-filled" color="#999" size="18"></uni-icons> -->
					</view>
				</uni-list-chat>
			</uni-list>
		</uni-list>
		

	</view>
</template>

<script>
	import {getMeetingInfoList} from '@/api/system/meeting.js'
	export default {
		onLoad: function() {
			getMeetingInfoList('').then(resq=>{
				this.meetingList = resq.data;
			})
		},
		data() {
			return {
				meetingList:'',
			};
		},
		methods:{
			getBackgroundColor(item){
				switch(item){
					case '未使用':
						return 'background-color:#ccc';
					case '使用中':
						return 'background-color:#ffaa00';
					default:
						return 'background-color:#fff';
						
				}
			}
		}
	}
</script>

<style lang="scss">
.uni-list-chat__content-extra{
	    justify-content: center;
}
.chat-custom-right{
	position: absolute;
    top: 0px;
    right: 0px;
}

</style>
